// TypeScript file
module Animation {

    /**
     * 
     */
    export class AnimationManager {
        /**初始化动画层 */
        constructor(tshowpanle) {
            this.showPanle = tshowpanle;
        }

        /**动画特效数组*/
        private productAnimations: BasicAnimaton[] = [];
        /**显示容器*/
        public showPanle: egret.DisplayObjectContainer;
        /**创建动画个数*/
        private static productAnimations = 0;


        /**创建,删除指定类型和位置*/
        public createDeleteAnimation(point, Type): egret.MovieClip {
            let Animation = new BasicAnimaton();
            var animation = new egret.MovieClip();
            Animation.init(this.showPanle, this, Type);
            animation = Animation.createAnimation(point, Type, AnimationManager.productAnimations);//绕一圈删除数组
            Animation.Animationdestory(Animation.Animation, Type);
            this.productAnimations.push(Animation);
            AnimationManager.productAnimations++;
            return animation;
        }
        /**从数组摧毁一架飞机*/
        public destoryOneAnmition(tid) {
            for (let i = this.productAnimations.length - 1; i >= 0; i++) {
                if (this.productAnimations[i].AnimationId = tid) {
                    this.productAnimations.splice(i, 1);
                    return;
                }
            }
        }

    }
}